/**
 * Copyright (c) qzsoft All rights reserved.
 *
 * qzsoft.cn
 *
 * 版权所有，侵权必究！
 */

package com.qzsoft.system.modules.permission.user.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.DefaultGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;
import com.qzsoft.system.modules.permission.deptJob.dto.SysUserDeptDTO;
import com.qzsoft.system.modules.permission.group.dto.SysGroupDTO;
import com.qzsoft.system.modules.permission.rolebusiness.dto.SysUserRoleBusinessVo;
import com.qzsoft.system.modules.permission.roleclass.dto.SysRoleClassTreeDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户管理
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0
 */
@Data
@ApiModel(value = "用户管理")
public class SysUserDTO implements Serializable {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "id")
	@Null(message = "{id.null}", groups = AddGroup.class)
	@NotNull(message = "{id.require}", groups = UpdateGroup.class)
	private Long id;

	@ApiModelProperty(value = "用户名", required = true)
	@NotBlank(message = "{sysuser.username.require}", groups = DefaultGroup.class)
	private String username;

	@ApiModelProperty(value = "职位描述")
	private String positionDesc;

	@ApiModelProperty(value = "密码")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	@NotBlank(message = "{sysuser.password.require}", groups = AddGroup.class)
	private String password;

	@ApiModelProperty(value = "姓名")
	private String realName;

	@ApiModelProperty(value = "头像")
	private String headUrl;

	@ApiModelProperty(value = "性别   0：男   1：女    2：保密", required = true)
	@Range(min = 0, max = 2, message = "{sysuser.gender.range}", groups = DefaultGroup.class)
	private Integer gender;

	@ApiModelProperty(value = "邮箱")
	private String email;

	@ApiModelProperty(value = "手机号")
	private String mobile;

	@ApiModelProperty(value = "部门PkID")
	private String deptPkId;

	@ApiModelProperty(value = "部门ID")
	private String deptId;
	@ApiModelProperty(value = "部门编码")
	private String code;

	@ApiModelProperty(value = "状态  0：停用    1：正常", required = true)
	@Range(min = 0, max = 1, message = "{sysuser.status.range}", groups = DefaultGroup.class)
	private Integer status;

	@ApiModelProperty(value = "创建时间")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
	private Date createDate;

	@ApiModelProperty(value = "简拼")
	private String spell;

	@ApiModelProperty(value = "上级汇报人id")
	private Long superiorId;

	@ApiModelProperty(value = "上级汇报人姓名")
	private String superiorName;

	@ApiModelProperty(value = "超级管理员   0：否   1：是")
	private Integer superAdmin;

	@ApiModelProperty(value = "角色ID列表")
	private List<Long> roleIdList;

	@ApiModelProperty(value = "部门名称")
	private String deptName;

	@ApiModelProperty(value = "机构和职务")
	private List<SysUserDeptDTO> deptJobList;

	@ApiModelProperty(value = "业务角色")
	private List<SysUserRoleBusinessVo> roleBusinessList;

	@ApiModelProperty(value = "用户组")
	private List<SysGroupDTO> userGroupList;

}
